<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/404',function () {
	return view('404');
});
Route::get('/','Home\IndexController@index');
Route::get('/cate/{cate_id}','Home\IndexController@cate');
Route::get('/art/{art_id}','Home\IndexController@article');
Route::any('login','Admin\LoginController@login');
Route::get('setCode','Admin\LoginController@setCode');

Route::group(['middleware'=>['web','checkLogin'],'prefix'=>'admin','namespace'=>'Admin'],function(){
	Route::get('index','IndexController@index');
	Route::get('info','IndexController@info');
	Route::get('list','AdminController@list');
	Route::get('tab','AdminController@tab');
	Route::get('img','AdminController@img');
	Route::get('element','AdminController@element');
	Route::any('update','AdminController@update');
	Route::any('pass','AdminController@pass');
	Route::any('checkout','AdminController@checkout');
	Route::any('upload','CommonController@upload');
	Route::post('cate/changeorder','CategoryController@changeOrder');
	Route::post('links/changeorder','LinksControllerinksController@changeOrder');
	Route::post('navs/changeorder','NavsController@changeOrder');
	Route::post('config/changeorder','ConfigController@changeOrder');
	Route::post('config/changecontent','ConfigController@changeContent');
	Route::get('config/putfile','ConfigController@putFile');

	Route::resource('category', 'CategoryController');
	Route::resource('article', 'ArticleController');
	Route::resource('links', 'LinksController');
	Route::resource('navs', 'NavsController');
	Route::resource('config', 'ConfigController');
});